gtk/window: Use default size if non-resizable if set
authorJonas Ådahl <jadahl@gmail.com>
Wed, 2 Dec 2020 15:44:25 +0000 (16:44 +0100)
committerJonas Ådahl <jadahl@gmail.com>
Mon, 7 Dec 2020 19:37:29 +0000 (20:37 +0100)
gtk/gtkwindow.c

index b3f848f8e172d7ac245f43a9e9080d80c850bdb3..42f35da09803bd73e2636c01cf588249985f032a 100644 (file)
@@ -4277,12 +4277,22 @@ toplevel_compute_size (GdkToplevel     *toplevel,
     }
   else if (!priv->resizable)
     {
-      width = nat_width;
-      height = nat_height;
-
-      gtk_window_update_csd_size (window,
-                                  &width, &height,
-                                  INCLUDE_CSD_SIZE);
+      if (info &&
+          info->default_width > 0 &&
+          info->default_height > 0)
+        {
+          width = info->default_width;
+          height = info->default_height;
+          gtk_window_update_csd_size (window, &width, &height,
+                                      INCLUDE_CSD_SIZE);
+        }
+      else
+        {
+          width = nat_width;
+          height = nat_height;
+          gtk_window_update_csd_size (window, &width, &height,
+                                      INCLUDE_CSD_SIZE);
+        }
     }
   else
     {